//directives
import TransferDom from '@/directives/transfer-dom';
import ClickOutside from '@/directives/click-outside';
import Ripple from '@/directives/ripple';
import Waves from '@/directives/waves';
import VueObserveVisibility from 'vue-observe-visibility';

//plugins
import BusPlugin from '@/plugins/bus/index.js';
//mixins
import resetForm from '@/mixins/reset-form';
import form from '@/mixins/form';
import grid from '@/mixins/grid';
import loading from '@/mixins/loading';
import dialog from '@/mixins/dialog';
import factory from '@/mixins/factory';
import pickerOption from '@/mixins/picker-options';
import tabs from '@/mixins/tabs';
import getCode from '@/mixins/get-code';
import subContent from '@/mixins/sub-content';
import getCommand from '@/mixins/get-command';

import updateBalance from '@/mixins/update-balance';
import capitalOperation from '@/mixins/capital-operation';
import logout from '@/mixins/logout';
import addressSelect from '@/mixins/address-select';
import swiper from '@/mixins/swiper';
import detailContent from '@/mixins/detail-content';


//components
import Pagination from 'element-ui/packages/pagination/index.js';
import Dialog from 'element-ui/packages/dialog/index.js';
import Autocomplete from 'element-ui/packages/autocomplete/index.js';
import Dropdown from 'element-ui/packages/dropdown/index.js';
import DropdownMenu from 'element-ui/packages/dropdown-menu/index.js';
import DropdownItem from 'element-ui/packages/dropdown-item/index.js';
import Menu from 'element-ui/packages/menu/index.js';
import Submenu from 'element-ui/packages/submenu/index.js';
import MenuItem from 'element-ui/packages/menu-item/index.js';
import MenuItemGroup from 'element-ui/packages/menu-item-group/index.js';
import Input from 'element-ui/packages/input/index.js';
import InputNumber from 'element-ui/packages/input-number/index.js';
import Radio from 'element-ui/packages/radio/index.js';
import RadioGroup from 'element-ui/packages/radio-group/index.js';
import RadioButton from 'element-ui/packages/radio-button/index.js';
import Checkbox from 'element-ui/packages/checkbox/index.js';
import CheckboxButton from 'element-ui/packages/checkbox-button/index.js';
import CheckboxGroup from 'element-ui/packages/checkbox-group/index.js';
import Switch from 'element-ui/packages/switch/index.js';
import Select from 'element-ui/packages/select/index.js';
import Option from 'element-ui/packages/option/index.js';
import OptionGroup from 'element-ui/packages/option-group/index.js';
import Button from 'element-ui/packages/button/index.js';
import ButtonGroup from 'element-ui/packages/button-group/index.js';
import Table from 'element-ui/packages/table/index.js';
import TableColumn from 'element-ui/packages/table-column/index.js';
import DatePicker from 'element-ui/packages/date-picker/index.js';
import TimeSelect from 'element-ui/packages/time-select/index.js';
import TimePicker from 'element-ui/packages/time-picker/index.js';
import Popover from 'element-ui/packages/popover/index.js';
import Tooltip from 'element-ui/packages/tooltip';
import MessageBox from 'element-ui/packages/message-box/index.js';
import Loading from 'element-ui/packages/loading/index.js';
import Breadcrumb from 'element-ui/packages/breadcrumb/index.js';
import BreadcrumbItem from 'element-ui/packages/breadcrumb-item/index.js';
import Form from 'element-ui/packages/form/index.js';
import FormItem from 'element-ui/packages/form-item/index.js';
import Tabs from 'element-ui/packages/tabs/index.js';
import TabPane from 'element-ui/packages/tab-pane/index.js';
import Tag from 'element-ui/packages/tag/index.js';
import Tree from 'element-ui/packages/tree/index.js';
import Alert from 'element-ui/packages/alert/index.js';
import Notification from 'element-ui/packages/notification/index.js';
import Slider from 'element-ui/packages/slider/index.js';
import Icon from 'element-ui/packages/icon/index.js';
import Row from 'element-ui/packages/row/index.js';
import Col from 'element-ui/packages/col/index.js';
import Upload from 'element-ui/packages/upload/index.js';
import Progress from 'element-ui/packages/progress/index.js';
import Spinner from 'element-ui/packages/spinner/index.js';
import Message from 'element-ui/packages/message/index.js';
import Badge from 'element-ui/packages/badge/index.js';
import Card from 'element-ui/packages/card/index.js';
import Rate from 'element-ui/packages/rate/index.js';
import Steps from 'element-ui/packages/steps/index.js';
import Step from 'element-ui/packages/step/index.js';
import Carousel from 'element-ui/packages/carousel/index.js';
import Scrollbar from 'element-ui/packages/scrollbar/index.js';
import CarouselItem from 'element-ui/packages/carousel-item/index.js';
import Collapse from 'element-ui/packages/collapse/index.js';
import CollapseItem from 'element-ui/packages/collapse-item/index.js';
import Cascader from 'element-ui/packages/cascader/index.js';
import ColorPicker from 'element-ui/packages/color-picker/index.js';
import Transfer from 'element-ui/packages/transfer/index.js';
import Container from 'element-ui/packages/container/index.js';
import Header from 'element-ui/packages/header/index.js';
import Aside from 'element-ui/packages/aside/index.js';
import Main from 'element-ui/packages/main/index.js';
import Footer from 'element-ui/packages/footer/index.js';
import CollapseTransition from 'element-ui/src/transitions/collapse-transition';
import VueAwesomeSwiper from 'vue-awesome-swiper';

import VeLine from 'v-charts/lib/line.common';

//components
import TimeoutCell from '@/components/timeout-cell';
import SvgIcon from '@/components/svg-icon';
import CustomerService from '@/components/customer-service';
import ValidateImg from '@/components/validate-img';
import Tip from '@/components/el-tip';
import Warning from '@/components/el-warning';
import MaskDropdown from '@/components/mask-dropdown';
import PasswordInput from '@/components/password-input';

import MessageTip from '@/components/message-tip/main';
import MemberDetail from '@/components/member-detail/main';
import AgentDetail from '@/components/agent-detail/main';
import CreditUp from '@/components/credit-up/main';
import CreditUpAgent from '@/components/credit-up-agent/main';
import CreditUpDetail from '@/components/credit-up-detail/main';
import GlobalMobile from '@/components/global-mobile';
import StaticContainer from '@/components/static-container';
import StaticContainerHeader from '@/components/static-container/static-container-header';
import StaticContainerBody from '@/components/static-container/static-container-body';

import CustomContainer from '@/components/custom-container';
import CustomContainerHeader from '@/components/custom-container/custom-container-header';
import CustomContainerBody from '@/components/custom-container/custom-container-body';

import CustomButtonGroup from '@/components/custom-button-group';
import CustomButton from '@/components/custom-button-group/custom-button';
import CloseButton from '@/components/close-button';
import DialogSubtitle from '@/components/dialog-subtitle';
import BadgeText from '@/components/badge-text';
import PaymentPic from '@/components/payment-pic';
import BankPic from '@/components/bank-pic';
import SubNav from '@/components/sub-nav';
import NavContainer from '@/components/nav-container';
import MoneyText from '@/components/money-text';
import HomepageTitle from '@/components/homepage-title';
import TweenNumber from '@/components/tween-number';
import MemberCell from '@/components/member-cell';
import qriously from "vue-qriously";

import 'swiper/dist/css/swiper.css';


import "@/themes/chalk/src/index.scss";

import '@/themes/common/_page-transitions.scss';

//filters
import filterImport from './filters'; // global filters

// register global utility filters.
filterImport();

//element-ui
const components = [
  Pagination,
  Dialog,
  Autocomplete,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Input,
  InputNumber,
  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxButton,
  CheckboxGroup,
  Switch,
  Select,
  Option,
  OptionGroup,
  Button,
  ButtonGroup,
  Table,
  TableColumn,
  DatePicker,
  TimeSelect,
  Tip,
  TimePicker,
  Popover,
  Tooltip,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Tabs,
  TabPane,
  Tag,
  Tree,
  Alert,
  Slider,
  Icon,
  Row,
  Col,
  Upload,
  Progress,
  Spinner,
  Badge,
  Card,
  Rate,
  Steps,
  Step,
  Carousel,
  Scrollbar,
  CarouselItem,
  Collapse,
  CollapseItem,
  Cascader,
  ColorPicker,
  Transfer,
  Container,
  Header,
  Aside,
  Main,
  Footer,
  CollapseTransition,
  CustomerService,
  TimeoutCell,
  ValidateImg,
  SvgIcon,
  MaskDropdown,
  Warning,
  PasswordInput,
  GlobalMobile,
  StaticContainer,
  StaticContainerHeader,
  StaticContainerBody,
  CustomButtonGroup,
  CustomButton,
  CloseButton,
  DialogSubtitle,
  BadgeText,
  SubNav,
  PaymentPic,
  BankPic,
  NavContainer,
  CustomContainer,
  CustomContainerHeader,
  CustomContainerBody,
  MoneyText,
  //chart
  VeLine,
  HomepageTitle,
  MemberCell,
  TweenNumber
];
import vueAwesomeSwiper from 'vue-awesome-swiper';
const install = (Vue) => {
  components.map(component => {
    Vue.component(component.name, component);
  });

  // Vue.use(Loading.directive);

  // Vue.prototype.$ELEMENT = {
  //   size: opts.size || '',
  //   zIndex: opts.zIndex || 2000
  // };

  Vue.prototype.$notify = Notification;
  Vue.prototype.$loading = Loading.service;
  Vue.prototype.$msgbox = MessageBox;
  Vue.prototype.$alert = MessageBox.alert;
  Vue.prototype.$confirm = MessageBox.confirm;
  Vue.prototype.$prompt = MessageBox.prompt;
  Vue.prototype.$notify = Notification;
  Vue.prototype.$message = Message;

  Vue.prototype.$messageTip = MessageTip;
  Vue.prototype.$memberDetail = MemberDetail;
  Vue.prototype.$agentDetail = AgentDetail;
  Vue.prototype.$creditUp = CreditUp;
  Vue.prototype.$creditUpAgent = CreditUpAgent;
  Vue.prototype.$creditUpDetail = CreditUpDetail;


  Vue.use(BusPlugin);
  Vue.use(VueAwesomeSwiper, /* { default global options } */ );
  Vue.use(VueObserveVisibility);
  Vue.use(qriously);


  Vue.use(vueAwesomeSwiper);
  Vue.directive('TransferDom', TransferDom);
  Vue.directive('Ripple', Ripple);
  Vue.directive('Waves', Waves);
  Vue.directive('ClickOutside', ClickOutside);
};

export {
  install,
  //directives
  ClickOutside,


  //plugins

  //factory

  //mixins
  resetForm,
  form,
  dialog,
  loading,
  factory,
  subContent,
  getCommand,
  grid,
  pickerOption,
  tabs,
  logout,
  getCode,
  capitalOperation,
  addressSelect,
  updateBalance,
  swiper,
  detailContent,
  //filters
};